
package codeGenerate.genConfig.tempalte;

import java.util.HashMap;
import java.util.Map;

import codeGenerate.mybatis.tempalte.TemPathAbstract;
import codeGenerate.mybatis.vo.ConfigVo;

public class TemPathMybatis3 extends TemPathAbstract {

	@Override
	public Map<String, String> getPathMap(ConfigVo configVo) {
		String srcPath = configVo.getGenPath() + "/src/" + configVo.getPack().replace(".", "/");

		Map<String, String> fileMap = new HashMap<String, String>();
		//后台代码
		fileMap.put("/mybatis3/src/common/constants.ftl", srcPath + "/common/" + configVo.getBeanName() + "Constants.java");
		fileMap.put("/mybatis3/src/entity/pojo.ftl", srcPath + "/entity/" + configVo.getBeanName() + ".java");
		fileMap.put("/mybatis3/src/entity/pojoQuery.ftl", srcPath + "/entity/" + configVo.getBeanName() + "QueryVo.java");
		fileMap.put("/mybatis3/src/entity/pojoShow.ftl", srcPath + "/entity/" + configVo.getBeanName() + "ShowVo.java");
		fileMap.put("/mybatis3/src/mappers/mapper.xml.ftl", srcPath + "/mappers/" + configVo.getBeanName() + "Mapper.xml");
		fileMap.put("/mybatis3/src/service/impl/serviceImpl.ftl", srcPath + "/service/impl/" + configVo.getBeanName() + "ServiceImpl.java");
		fileMap.put("/mybatis3/src/service/service.ftl", srcPath + "/service/" + configVo.getBeanName() + "Service.java");
		fileMap.put("/mybatis3/src/web/controller.ftl", srcPath + "/web/" + configVo.getBeanName() + "Controller.java");
		//前台代码
		String jspPath = configVo.getGenPath() + "/jsp";
		String jspFileName = configVo.getBeanName().substring(0, 1).toLowerCase() + configVo.getBeanName().substring(1);
		fileMap.put("/mybatis3/jsp/view.ftl", jspPath + "/" + jspFileName + "/view.jsp");
		fileMap.put("/mybatis3/jsp/list.ftl", jspPath + "/" + jspFileName + "/list.jsp");
		fileMap.put("/mybatis3/jsp/edit.ftl", jspPath + "/" + jspFileName + "/edit.jsp");
		fileMap.put("/mybatis3/jsp/add.ftl", jspPath + "/" + jspFileName + "/add.jsp");
		//h5代码
		String h5Path = configVo.getGenPath() + "/apph5";
		fileMap.put("/mybatis3/apph5/add.ftl", h5Path + "/" + jspFileName + "/add.html5");
		return fileMap;
	}

}
